package com.enation.app.javashop.api.client;

import com.enation.app.javashop.model.distribution.dos.DistributionOrder;
import com.enation.app.javashop.model.distribution.dos.DistributionOrderDO;
import com.enation.app.javashop.model.distribution.dto.DistributionRefundDTO;
import com.enation.app.javashop.service.distribution.BillMemberManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * @author fk
 * @version v2.0
 * @Description:
 * @date 2018/8/16 15:25
 * @since v7.0.0
 */
@RestController
@RequestMapping("/client/bill-member")
@Validated
@ApiIgnore
public class BillMemberClientController {

    @Autowired
    private BillMemberManager billMemberManager;

    /**
     * 购买商品产生的结算
     *
     * @param order
     */
    @PostMapping("/buy")
    public void buyShop(@RequestBody DistributionOrderDO order) {
        billMemberManager.buyShop(order);
    }

    /**
     * 退货商品产生的结算
     *
     * @param distributionOrder
     */
    @PostMapping("/return")
    public void returnShop(@RequestBody DistributionOrder distributionOrder) {
        billMemberManager.returnShop(distributionOrder);
    }
}
